package retrofit.boot.autoconfigure;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import retrofit.ErrorHandler;
import retrofit.Profiler;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import retrofit.converter.Converter;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wulg on 2019/10/28
 * description:
 */
@Data
@ConfigurationProperties(prefix = "retrofit.client")
public class RetrofitClientProperties {

    private String defaultConfig = "default";

    private String defalutCharset = "UTF-8";

    private Map<String,RetrofitClientProperties.RetrofitClientConfiguration> config = new HashMap<>();//缺省就默认

    @Data
    public static class RetrofitClientConfiguration {

        private Integer timeout;

        private String url;

        private RestAdapter.LogLevel logLevel;

        private Class<? extends ErrorHandler> errorHandler;

        private Class<? extends RequestInterceptor> requestInterceptor;

        private Class<? extends Converter> converter;

        private Class<? extends Profiler> profiler;

    }
}
